<?php
/**
 * Created by PhpStorm
 * USER MingTingLiang   QQ 915802070
 * Date 2020-12-15-015   19:18
 */



///http://www.monstertrain.com/03delegator/show.php
require "User.php";
require "VIPUser.php";
require "CorUser.php";
require "Dog.php";


$dog = new Dog();
$user_id = 101;
$user = new User($user_id);

$user->delegator = new VIPUser($user_id);

echo "VIP用户买狗的价格是" . $dog->getPrice() * $user->getVIPDiscount();
echo "<br/>";

$user->delegator = new CorUser($user_id);

echo "第三方用户买狗的价格是" . $dog->getPrice() * $user->getCorDiscount();
echo "<br/>";
